<?php

namespace support\spark\plugin\helpers;

class Install
{
    public  static  function  execute($name){

        $class = "\\plugin\\$name\\api\\Install";
        if (!method_exists($class, 'install')) {
            throw new \RuntimeException("Method $class::install not exists");
        }
        call_user_func([$class, 'install'], config("plugin.$name.app.version"));
        return true;
    }
}